<?php

class GuidaController extends Zend_Controller_Action
{
    /**
     * @var Application_Model_Guidas 
     */
    protected $_guidas;

    public function init()
    {
        // Breadcrumbs configuration
        $uri = $this->_request->getPathInfo();
        $activeNav = $this->view->navigation()->findByUri($uri);
        if ($activeNav) { // Controllo per evitare "Strict standards: Creating default object from empty value"
            $activeNav->active = true;
        }
        
        // Inizialize guida model
        $this->_guidas = new Application_Model_Guidas;
    }

    public function indexAction()
    {
        $ident = $this->_getParam('ident');
        $guida = $this->_guidas->getGuidaByIdent($ident);
        
        // Set the variables to the view
        $this->view->nome = $guida->guidaNome;
        $this->view->email = $guida->guidaEmail;
        $this->view->tel = $guida->guidaTel;
        $this->view->fotoPath = $guida->guidaFoto;
    }


}

